<template>
    <div>
        <img
            class="back"
            :src="backImg"
        >
        <div class="cont">
            <div>奖金口令</div>
            <div>{{code}}</div>
            <div>
                请返回原平台首页点击输入口令按钮领取奖励
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: "getPassword",
    data() {
        return {
            backImg: '',
            code: '',
        };
    },
    methods: {
        // 方法
        click() {

        },
        getBackUrl() {
            let params = {
            };
            this.$post("/index/get_config", params)
                .then(res => {
                    if (res.code === 20000) {
                        this.backImg = res.data.get_kouling_img
                    }
                })
                .catch(err => { });
        },
        getId() {
            let params = {
                id: this.$route.query.id,
            };
            this.$post("/weixinhao/get_word", params)
                .then(res => {
                    if (res.code === 20000) {
                        this.code = res.data
                    }
                })
                .catch(err => { });
        },
    },
    beforeCreate() {
        document.querySelector("body").setAttribute("style", "background-color:#fff");
    },
    created() {
        // 实例创建完成
        this.getBackUrl();
        this.getId();
        // this.getCode();
    },
};
</script>
<style lang="less" scoped>
.back {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cont {
    position: fixed;
    bottom: 15px;
    left: 50%;
    margin-left: -172.5px;
    width: 345px;
    height: 170px;
    background-image: linear-gradient(44deg, #fbd249 0%, #f5a623 100%);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    > div:nth-of-type(1) {
        font-size: 18px;
        color: #cb2e2e;
        font-weight: bold;
        position: relative;
    }
    > div:nth-of-type(1)::after {
        content: "";
        position: absolute;
        top: 50%;
        left: -130%;
        background: #fff;
        width: 80px;
        height: 2px;
    }
    > div:nth-of-type(1)::before {
        content: "";
        position: absolute;
        top: 50%;
        right: -130%;
        background: #fff;
        width: 80px;
        height: 2px;
    }
    > div:nth-of-type(2) {
        margin-top: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 314px;
        height: 62px;
        background-color: #f2f3ff;
        box-shadow: inset 0px 0px 6px 0px rgba(0, 0, 0, 0.3);
        border-radius: 31px;
        font-size: 32px;
        color: #333333;
    }
    > div:nth-of-type(3) {
        margin-top: 10px;
        font-size: 15px;
        color: #d0021b;
    }
}
</style>